<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta http-equiv="Access-Control-Allow-Origin" content="*">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="format-detection" content="telephone=no">
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">		
		<title></title>	
		<link rel="stylesheet" href="../../../javascript/plug-ins/layui/css/layui.css" media="all" />		
		<link rel="stylesheet" href="../../../css/style.css" />			
		<script src="../../../javascript/jquery.js"></script>
		<script type="text/javascript" src="../../../javascript/plug-ins/layui/layui.js"></script>	

        <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=6ea17f64f74e24962ba25bac2383cd36&plugin=AMap.Autocomplete,AMap.PlaceSearch"></script>		
	    <script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>   
		<script src="js/add_shop.js">  </script>
		
		
	</head>
	<body>
		
	   <div class="page-wrap">		
		
		<section class="page-hd t">         
         <header>
			<h5 class="title">
				<a href="laundry_pro_type.html" class="red">编辑店铺</a>
			</h5>	
		 </header>
		 <hr>
		</section>
		
		<div class="panel panel-default">
		 
		 <div class="form-content">
		 	
		 	<form>
		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">门头：</div>
		 			<div class="form-cont">
		                <input class="btn btn-warning" value="请上传图片" type="button" id="uploadimgs"/>
		                <span class="word-aux">图片像素为630*542，图片不大于66kb</span>
		 			</div>
		 		</div>
		 		
		 		<div class="form-group-col-2" id="divpreview" style="display:none">
		 			<div class="form-label"></div>
		 			<div class="form-cont">
		                  <img  id="preview" src="../../../img/user-img0.jpg" height="100" />
						  <p id="demoText"></p>
		 			</div>
		 		</div>
		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">店名：</div>
		 			<div class="form-cont">
		 			  <input id="sname" type="text" value="" placeholder="请输入店名" class="form-control form-boxed width20" />
		 			</div>
		 		</div>	
		 		
				<div class="form-group-col-2">
		 			<div class="form-label">城市：</div>
		 			<div class="form-cont">
		 				<select class="width20" id="bigid" onchange="comm_small(this)"><option value="0">请选择城市</option></select>
		 			</div>
		 		</div>
		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">地区：</div>
		 			<div class="form-cont">
		 				<select class="width20" id="smallid" onchange="getcomm_small(this)"><option value="0">请选择地区</option></select>
		 			</div>
		 		</div>
		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">地址：</div>
		 			<div class="form-cont">
		 			  <input type="text" id="saddr" value="" placeholder="请输入地址" class="form-control form-boxed width20" />
		 			</div>
		 		</div>	
		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">定位：</div>
		 			<div class="form-cont">
		 			  <input type="text" id="slitude" readonly value="" placeholder="请定位" class="form-control form-boxed width20" /> 			
		 			</div>
		 		</div>	
		 		
		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label">营业时间：</div>
		 			<div class="form-cont">
		 				 <input type="text" id="stime" value="" placeholder="请输入营业时间" class="form-control form-boxed width20" /> 			
		 			</div>
		 		</div>
		 		
		 	    <div class="form-group-col-2">
		 			<div class="form-label">联系电话：</div>
		 			<div class="form-cont">
		 			  <input type="text" value="" id="stel" placeholder="请输入联系电话" class="form-control form-boxed width20" /> 			
		 			</div>
		 		</div>	
		 				 				 		
		 		 		
		 		<div class="form-group-col-2">
		 			<div class="form-label"></div>
		 			<div class="form-cont">
                       <input type="button" value="提交" class="btn btn-info"  onclick="update()" />
					   <input type="button" value="返回" class="btn btn-danger" onclick="returnlist()"/>
		 			</div>
		 		</div>    
				<div id="container" style="width: 67%;height: 100%; border:1px solid red;position: fixed; right: 0px;top: 0px; display:none"></div>
				<script type="text/javascript">
				//地图加载
				var map = new AMap.Map("container", {
					resizeEnable: true
				});
				//输入提示
				var autoOptions = {
					input: "saddr"
				};
				var auto = new AMap.Autocomplete(autoOptions);
				var placeSearch = new AMap.PlaceSearch({
					map: map
				});  //构造地点查询类
				
				AMap.event.addListener(auto, "select", select);//注册监听，当选中某条记录时会触发
				function select(e) {         			
					placeSearch.setCity(e.poi.adcode);
					placeSearch.search(e.poi.name);  //关键字查询查询
				}
				
				 //为地图注册click事件获取鼠标点击出的经纬度坐标
				var clickEventListener = map.on('click', function(e) {
					document.getElementById("slitude").value = e.lnglat.getLng() + ',' + e.lnglat.getLat(); 
				});
				AMap.plugin('AMap.Geocoder',function(){
					var geocoder = new AMap.Geocoder({
						city: "010"//城市，默认：“全国”
					});
					var marker = new AMap.Marker({
						map:map,
						bubble:true
					})
					map.on('click',function(e){
						marker.setPosition(e.lnglat);
						geocoder.getAddress(e.lnglat,function(status,result){
						  if(status=='complete'){
							 document.getElementById('saddr').value = result.regeocode.formattedAddress
						  }
						})
					})

				});
				</script>
			</form>
		 	
		 	
		 </div><!--form-content--->
		
		
		</div><!---panel--->
			
	   </div><!---page-wrap------>		
		
		
	</body>

	
</html>
